

import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
import 'package:get/get.dart';

import '../../app_session.dart';

class ToastUtil {
  static Future<void> show(String msg, {Duration? duration}) async {
    if (msg.isEmpty) return;
    if (Get.overlayContext == null) return;
    int seconds = 3;
    // showToast(msg, context: Get.overlayContext, duration: duration ?? Duration(seconds: seconds), position: StyledToastPosition.center, backgroundColor: Colors.black, animation: StyledToastAnimation.scale, reverseAnimation: StyledToastAnimation.scale);
    SmartDialog.showToast(msg);
    logger.w('toast提示了:$msg');
  }

  static void showLoading() {
    SmartDialog.showLoading();
  }

  static void dismiss() {
    SmartDialog.dismiss();
  }
}